home *** CD-ROM | disk | FTP | other *** search
-
- #import "Interval.h"
-
- @implementation Interval
- - (BOOL)isIn:(unsigned long)number
- {
- if((number>=from) && (number<=to))
- return TRUE;
- else
- return FALSE;
- }
-
- - (unsigned long)lowerBound
- {
- return from;
- }
-
- - (unsigned long)upperBound
- {
- return to;
- }
-
- - initWithLower:(unsigned long)low upper:(unsigned long)high
- {
- [self init];
- from=low;
- to=high;
- return self;
- }
-
- - dumpAsAsciiIn:(NXStream *)aStream;
- {
-
- if(from<to)
- NXPrintf(aStream,"%d-%d",from,to);
- else if(from==to)
- NXPrintf(aStream,"%d",from);
- return self;
- }
-
-
-
- @end
-